<template>
	<view class="paper-list">
		<view class="setting-box">
			<u-cell :title="item.name" v-for="item in temList" :key="item.id" @click="goEdit(item)">
				<view slot="value" class="u-slot-value">
					<u-icon name="edit-pen" color="#6C7DAF"></u-icon>
					<text>编辑</text>
				</view>
			</u-cell>

			<!-- 	<u-cell title="厨打单">
				<view slot="value" class="u-slot-value">
					<u-icon name="edit-pen" color="#6C7DAF"></u-icon>
					<text>编辑</text>
				</view>
			</u-cell> -->
		</view>
	</view>
</template>

<script>
import { provide } from 'vue';
import { mapMutations } from 'vuex';
export default {
	data() {
		return {
			list: [
				{ title: '结账单', prop: 'statement', route: '/pages/workbench/paperSetting/kitchenEdit' },
				{ title: '厨打单', prop: 'kitchen ', route: '/pages/workbench/paperSetting/kitchenEdit' }
			],
			temList: []
		};
	},

	onShow() {
		this.getSettingInfo();
	},
	methods: {
		...mapMutations('printPaperSetting', ['setPrintTem']),
		goEdit(row) {
			this.setPrintTem(row);
			uni.navigateTo({
				url: this.list[1].route
			});
		},
		async getSettingInfo() {
			const res = await this.$api.getPrintingPaperSettingAPI();
			this.temList = res.data;
		}
	}
};
</script>

<style scoped lang="scss">
.paper-list {
	padding: 20rpx;
	.setting-box {
		background-color: #fff;
		.u-slot-value {
			display: flex;
			text-align: center;
			font-size: 26rpx;
			border-radius: 10rpx;
			color: #6c7daf;
		}
	}
}
</style>
